#ifndef  __PID_H__
#define  __PID_H__

#define		KP		0.105
/* --------------------------------- */
#define		KPP		2.45*KP
#define		KPI		3.50*KP
#define		KPD		1.25*KP
/* --------------------------------- */
#define		CAPBSIZE	16
#define		SHIFTDIV	4

#define		MAXPWM	1295
#define		MINPWM	660

typedef union {
unsigned char bytet[4];
float num;
}PID_TYPE;	

void PIDSetPoint(int setpoint);
int PIDGetSetpoint(void);
void PIDSetKp(double dKpp);
double PIDGetKp(void);
void PIDSetKi(double dKii);
double PIDGetKi(void);
void PIDSetKd(double dKdd);
double PIDGetKd(void);
int IncPIDCalc(int NextPoint);

#endif
